export interface DarkModeSettings {
    brightness: number;
    contrast: number;
    sepia: number;
    enabled: boolean;
  }
  
  export function applyDarkMode(settings: DarkModeSettings): void {
    const { brightness, contrast, sepia, enabled } = settings;
    if (!enabled) {
      document.documentElement.style.filter = 'none';
      return;
    }
  
    const filterValue = `brightness(${brightness}%) contrast(${contrast}%) sepia(${sepia}%)`;
    document.documentElement.style.filter = filterValue;
  }
  
  export function createDarkModeStyle(settings: DarkModeSettings): string {
    return `
      html {
        background-color: #1a1a1a !important;
        filter: invert(100%) hue-rotate(180deg) brightness(${settings.brightness}%) contrast(${settings.contrast}%) sepia(${settings.sepia}%) !important;
      }
      body {
        background-color: #fff !important;
      }
      img, video, canvas, [style*="background-image"] {
        filter: invert(100%) hue-rotate(180deg) !important;
      }
      /* 覆盖可能的内联样式 */
      * {
        background-color: inherit !important;
      }
    `;
  }
  